package com.cn.hotel.service.impl;

import com.cn.hotel.dao.IRoomTypeDao;
import com.cn.hotel.dao.Impl.RoomtypeImpl;
import com.cn.hotel.model.RoomTypeModel;
import com.cn.hotel.service.IRoomTypeService;

import java.util.List;

public class RoomTypeServiceImpl implements IRoomTypeService {
    @Override
    public List<RoomTypeModel> findAll(RoomTypeModel roomTypeModel) {
        IRoomTypeDao iRoomTypeDao = new RoomtypeImpl();
        return iRoomTypeDao.findAll(roomTypeModel);
    }

    @Override
    public int getNumber(RoomTypeModel roomTypeModel) {
        IRoomTypeDao iRoomTypeDao = new RoomtypeImpl();
        return iRoomTypeDao.getNumber(roomTypeModel);
    }

    @Override
    public int add(RoomTypeModel roomTypeModel) {
        IRoomTypeDao iRoomTypeDao = new RoomtypeImpl();
        return iRoomTypeDao.add(roomTypeModel);
    }

    /**
     * 通过id查询信息 给编辑页面赋值
     * @param temp
     * @return
     */
    @Override
    public RoomTypeModel findById(Integer temp) {
        IRoomTypeDao iRoomTypeDao = new RoomtypeImpl();
        return iRoomTypeDao.finById(temp);
    }
//保存编辑
    @Override
    public int edit(RoomTypeModel roomTypeModel) {
        IRoomTypeDao iRoomTypeDao = new RoomtypeImpl();
        return iRoomTypeDao.edit(roomTypeModel);
    }

    @Override
    public int delete(Integer aa) {
        IRoomTypeDao iRoomTypeDao = new RoomtypeImpl();
        return iRoomTypeDao.delete(aa);
    }
//------------------下面是前端页面调取数据逻辑代码------------------------

    /**
     * 网站首页调取
     * @return
     */
    //网站首页调取
    @Override
    public List<RoomTypeModel> getRoomTypeModelList() {
        IRoomTypeDao iRoomTypeDao = new RoomtypeImpl();
        return iRoomTypeDao.getRoomTypeModelList();
    }
}
